using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._AttributeRules
{
    /// <summary>
    /// <para>Alter Attribute Rule</para>
    /// <para>Alters the properties of an attribute rule.</para>
    /// <para>更改属性规则的属性。</para>
    /// </summary>    
    [DisplayName("Alter Attribute Rule")]
    public class AlterAttributeRule : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AlterAttributeRule()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The table containing the attribute rule to be altered.</para>
        /// <para>包含要更改的属性规则的表。</para>
        /// </param>
        /// <param name="_name">
        /// <para>Rule Name</para>
        /// <para>The name of the attribute rule that will be altered.</para>
        /// <para>将要更改的属性规则的名称。</para>
        /// </param>
        public AlterAttributeRule(object _in_table, object _name)
        {
            this._in_table = _in_table;
            this._name = _name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Alter Attribute Rule";

        public override string CallName => "management.AlterAttributeRule";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_table, _name, _description, _error_number, _error_message, _tags, _updated_table, _triggering_events, _script_expression, _exclude_from_client_evaluation.GetGPValue()];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The table containing the attribute rule to be altered.</para>
        /// <para>包含要更改的属性规则的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Rule Name</para>
        /// <para>The name of the attribute rule that will be altered.</para>
        /// <para>将要更改的属性规则的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Rule Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _name { get; set; }


        /// <summary>
        /// <para>Description</para>
        /// <para>The description of the attribute rule. To clear the current value of the description, choose the Reset option from the drop-down menu.</para>
        /// <para>属性规则的描述。要清除描述的当前值，请从下拉菜单中选择重置选项。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Description")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _description { get; set; } = null;


        /// <summary>
        /// <para>Error Number</para>
        /// <para>The error number of the attribute rule. To clear the current value of the error number for a calculation rule, choose the Reset option from the drop-down menu. Error number is a required property for constraint and validation rules and cannot be cleared.</para>
        /// <para>属性规则的错误号。要清除计算规则的错误号的当前值，请从下拉菜单中选择重置选项。错误号是约束和验证规则的必需属性，无法清除。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Error Number")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _error_number { get; set; } = null;


        /// <summary>
        /// <para>Error Message</para>
        /// <para>The error message of the attribute rule. To clear the current value of the error message for a calculation rule, choose the Reset option from the drop-down menu. Error message is a required property for constraint and validation rules and cannot be cleared.</para>
        /// <para>属性规则的错误消息。要清除计算规则的错误消息的当前值，请从下拉菜单中选择重置选项。错误消息是约束和验证规则的必需属性，无法清除。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Error Message")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _error_message { get; set; } = null;


        /// <summary>
        /// <para>Tags</para>
        /// <para>The tags for the attribute rule. To clear all tags, click to remove each tag from the list, and select Reset from the drop-down menu.</para>
        /// <para>属性规则的标记。要清除所有标签，请单击以从列表中删除每个标签，然后从下拉菜单中选择重置。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Tags")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _tags { get; set; } = null;


        /// <summary>
        /// <para>Updated Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _updated_table { get; set; }


        /// <summary>
        /// <para>Triggering Events</para>
        /// <para><xdoc>
        ///   <para>Specifies the editing events that will trigger the attribute rule to take effect. Triggering events are only applicable for constraint rules and calculation rules that have the Batch parameter set to false. Be aware that the new values will replace existing triggering events. To keep the current triggering events, leave this parameter empty.</para>
        ///   <bulletList>
        ///     <bullet_item>Insert—The rule will be applied when a new feature is added.</bullet_item><para/>
        ///     <bullet_item>Update—The rule will be applied when a feature is updated.</bullet_item><para/>
        ///     <bullet_item>Delete—The rule will be applied when a feature is deleted.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将触发属性规则生效的编辑事件。触发事件仅适用于 Batch 参数设置为 false 的约束规则和计算规则。请注意，新值将替换现有的触发事件。若要保留当前触发事件，请将此参数留空。</para>
        ///   <bulletList>
        ///     <bullet_item>插入 - 添加新要素时将应用规则。</bullet_item><para/>
        ///     <bullet_item>更新 - 更新要素时将应用规则。</bullet_item><para/>
        ///     <bullet_item>删除 - 删除要素时将应用规则。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Triggering Events")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _triggering_events { get; set; } = null;


        /// <summary>
        /// <para>Script Expression</para>
        /// <para>An Arcade expression that defines the rule. To keep the current expression, leave this parameter empty. Be aware that if an expression is provided for this parameter, it will replace the existing Arcade expression of the rule. If you alter the script expression of a batch calculation or validation rule, the rule will need to be reevaluated.</para>
        /// <para>定义规则的 Arcade 表达式。若要保留当前表达式，请将此参数留空。请注意，如果为此参数提供了表达式，它将替换规则的现有 Arcade 表达式。如果更改批处理计算或验证规则的脚本表达式，则需要重新计算该规则。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Script Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _script_expression { get; set; } = null;


        /// <summary>
        /// <para>Exclude From Client Evaluation</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the rule will be evaluated before edits are applied. The default for this property corresponds to the current value set for the rule. That is, if the input rule has the exclude from client evaluation property set to false, the default for this parameter will be unchecked so as to not modify the property without you specifically choosing to do so. This parameter is not applicable for validation rules or batch calculation rules.
        ///   <bulletList>
        ///     <bullet_item>Checked—The rule will be excluded from client evaluation.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The rule will be executed for all clients.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在应用编辑之前是否对规则进行评估。此属性的默认值对应于为规则设置的当前值。也就是说，如果输入规则将 exclude from client evaluation 属性设置为 false，则此参数的默认值将被取消选中，以便在您未明确选择的情况下不会修改该属性。该参数不适用于验证规则或批量计算规则。
        ///   <bulletList>
        ///     <bullet_item>选中 - 规则将从客户端评估中排除。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将对所有客户端执行该规则。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Exclude From Client Evaluation")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _exclude_from_client_evaluation_value _exclude_from_client_evaluation { get; set; } = _exclude_from_client_evaluation_value._false;

        public enum _exclude_from_client_evaluation_value
        {
            /// <summary>
            /// <para>EXCLUDE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXCLUDE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>INCLUDE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INCLUDE")]
            [GPEnumValue("false")]
            _false,

        }

        public AlterAttributeRule SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}